home *** CD-ROM | disk | FTP | other *** search
/ Champak 66 / Vol 66.iso / games / balones.swf / scripts / DefineSprite_341 / frame_6 / DoAction_2.as next >
Encoding:
Text File  |  2013-04-24  |  7.0 KB  |  197 lines

  1. this.nNamugi = _root.strClick1 - _root.strClick2;
  2. if(this.nNamugi == 10 || this.nNamugi == 1 || this.nNamugi == -10 || this.nNamugi == -1)
  3. {
  4.    eval("_root.mcB.mcM" + _root.strClick1).gotoAndStop(eval("_root.mcB.mcM" + _root.strClick2).nType);
  5.    eval("_root.mcB.mcM" + _root.strClick2).gotoAndStop(eval("_root.mcB.mcM" + _root.strClick1).nType);
  6.    _root.arrM[_root.strClick1.substr(0,1)][_root.strClick1.substr(1,1)] = eval("_root.mcB.mcM" + _root.strClick2).nType;
  7.    _root.arrM[_root.strClick2.substr(0,1)][_root.strClick2.substr(1,1)] = eval("_root.mcB.mcM" + _root.strClick1).nType;
  8.    eval("_root.mcB.mcM" + _root.strClick1).nType = _root.arrM[_root.strClick1.substr(0,1)][_root.strClick1.substr(1,1)];
  9.    eval("_root.mcB.mcM" + _root.strClick2).nType = _root.arrM[_root.strClick2.substr(0,1)][_root.strClick2.substr(1,1)];
  10.    if(this.nNamugi == 10)
  11.    {
  12.       eval("_root.mcB.mcM" + _root.strClick1 + ".mcM").gotoAndPlay("flUp");
  13.       eval("_root.mcB.mcM" + _root.strClick2 + ".mcM").gotoAndPlay("flDown");
  14.    }
  15.    else if(this.nNamugi == 1)
  16.    {
  17.       eval("_root.mcB.mcM" + _root.strClick1 + ".mcM").gotoAndPlay("flRight");
  18.       eval("_root.mcB.mcM" + _root.strClick2 + ".mcM").gotoAndPlay("flLeft");
  19.    }
  20.    else if(this.nNamugi == -10)
  21.    {
  22.       eval("_root.mcB.mcM" + _root.strClick1 + ".mcM").gotoAndPlay("flDown");
  23.       eval("_root.mcB.mcM" + _root.strClick2 + ".mcM").gotoAndPlay("flUp");
  24.    }
  25.    else if(this.nNamugi == -1)
  26.    {
  27.       eval("_root.mcB.mcM" + _root.strClick1 + ".mcM").gotoAndPlay("flLeft");
  28.       eval("_root.mcB.mcM" + _root.strClick2 + ".mcM").gotoAndPlay("flRight");
  29.    }
  30.    this.nMatch = 0;
  31.    _root.arrInitMatch = new Array();
  32.    this.arrNumber = new Array();
  33.    this.arrAnimal = new Array();
  34.    a = 0;
  35.    while(a <= 12)
  36.    {
  37.       b = 0;
  38.       while(b <= 12)
  39.       {
  40.          if(_root.arrM[a][b] == _root.arrM[a][b + 1] & _root.arrM[a][b + 1] == _root.arrM[a][b + 2])
  41.          {
  42.             if(_root.strClick1.substr(0,1) == a || _root.strClick2.substr(0,1) == a)
  43.             {
  44.                if(_root.strClick1.substr(1,1) == b || _root.strClick1.substr(1,1) == String(b + 1) || _root.strClick1.substr(1,1) == String(b + 2) || _root.strClick2.substr(1,1) == b || _root.strClick2.substr(1,1) == String(b + 1) || _root.strClick2.substr(1,1) == String(b + 2))
  45.                {
  46.                   if(_root.mcB.mcS.isGaro == 1 & a == _root.nBonus)
  47.                   {
  48.                      _root.mcB.mcS.isGaro = 0;
  49.                      _root.nBonus = "";
  50.                      _root.isBonus = 1;
  51.                   }
  52.                   _root.arrInitMatch[this.nMatch] = String(a) + String(b);
  53.                   this.nMatch = this.nMatch + 1;
  54.                   _root.arrInitMatch[this.nMatch] = String(a) + String(b + 1);
  55.                   this.nMatch = this.nMatch + 1;
  56.                   _root.arrInitMatch[this.nMatch] = String(a) + String(b + 2);
  57.                   this.nMatch = this.nMatch + 1;
  58.                }
  59.             }
  60.          }
  61.          if(_root.arrM[a][b] == _root.arrM[a + 1][b] & _root.arrM[a + 1][b] == _root.arrM[a + 2][b])
  62.          {
  63.             if(_root.strClick1.substr(0,1) == a || _root.strClick1.substr(0,1) == String(a + 1) || _root.strClick1.substr(0,1) == String(a + 2) || _root.strClick2.substr(0,1) == a || _root.strClick2.substr(0,1) == String(a + 1) || _root.strClick2.substr(0,1) == String(a + 2))
  64.             {
  65.                if(_root.strClick1.substr(1,1) == b || _root.strClick2.substr(1,1) == b)
  66.                {
  67.                   if(_root.mcB.mcS.isSero == 1 & a == _root.nBonus)
  68.                   {
  69.                      _root.mcB.mcS.isSero = 0;
  70.                      _root.nBonus = "";
  71.                      _root.isBonus = 1;
  72.                   }
  73.                   _root.arrInitMatch[this.nMatch] = String(a) + String(b);
  74.                   this.nMatch = this.nMatch + 1;
  75.                   _root.arrInitMatch[this.nMatch] = String(a + 1) + String(b);
  76.                   this.nMatch = this.nMatch + 1;
  77.                   _root.arrInitMatch[this.nMatch] = String(a + 2) + String(b);
  78.                   this.nMatch = this.nMatch + 1;
  79.                }
  80.             }
  81.          }
  82.          b++;
  83.       }
  84.       a++;
  85.    }
  86.    if(_root.isBonus == 1)
  87.    {
  88.       _root.isBonus = 0;
  89.       eval("_root.mcB.mcM" + _root.strClick2).nType = eval("_root.mcB.mcM" + _root.strClick2)._currentframe;
  90.       a = 0;
  91.       while(a <= 10)
  92.       {
  93.          b = 0;
  94.          while(b <= 10)
  95.          {
  96.             if(_root.arrM[a][b] == eval("_root.mcB.mcM" + _root.strClick2).nType)
  97.             {
  98.                _root.arrInitMatch[this.nMatch] = String(a) + String(b);
  99.                this.nMatch = this.nMatch + 1;
  100.             }
  101.             b++;
  102.          }
  103.          a++;
  104.       }
  105.    }
  106.    this.nMatch = 0;
  107.    d = 0;
  108.    while(d < _root.arrInitMatch.length)
  109.    {
  110.       isCheck = 1;
  111.       if(this.nMatch >= 1)
  112.       {
  113.          c = 0;
  114.          while(c < this.nMatch)
  115.          {
  116.             if(this.arrNumber[c] == _root.arrInitMatch[d])
  117.             {
  118.                isCheck = 0;
  119.             }
  120.             c++;
  121.          }
  122.       }
  123.       if(isCheck)
  124.       {
  125.          this.arrNumber[this.nMatch] = _root.arrInitMatch[d];
  126.          this.nDeleteAnimal = eval("_root.mcB.mcM" + this.arrNumber[this.nMatch])._currentframe - 1;
  127.          if(this.nDeleteAnimal == 1)
  128.          {
  129.             _root.plus_obj_num = 1;
  130.             _root.mcP.nA1 = _root.mcP.nA1 + 1;
  131.          }
  132.          else if(this.nDeleteAnimal == 2)
  133.          {
  134.             _root.plus_obj_num = 2;
  135.             _root.mcP.nA2 = _root.mcP.nA2 + 1;
  136.          }
  137.          else if(this.nDeleteAnimal == 3)
  138.          {
  139.             _root.plus_obj_num = 3;
  140.             _root.mcP.nA3 = _root.mcP.nA3 + 1;
  141.          }
  142.          else if(this.nDeleteAnimal == 4)
  143.          {
  144.             _root.plus_obj_num = 4;
  145.             _root.mcP.nA4 = _root.mcP.nA4 + 1;
  146.          }
  147.          else if(this.nDeleteAnimal == 5)
  148.          {
  149.             _root.plus_obj_num = 5;
  150.             _root.mcP.nA5 = _root.mcP.nA5 + 1;
  151.          }
  152.          else if(this.nDeleteAnimal == 6)
  153.          {
  154.             _root.plus_obj_num = 6;
  155.             _root.mcP.nA6 = _root.mcP.nA6 + 1;
  156.          }
  157.          else if(this.nDeleteAnimal == 7)
  158.          {
  159.             _root.plus_obj_num = 7;
  160.             _root.mcP.nA7 = _root.mcP.nA7 + 1;
  161.          }
  162.          this.arrAnimal[this.nMatch] = this.nDeleteAnimal;
  163.          this.nMatch = this.nMatch + 1;
  164.       }
  165.       d++;
  166.    }
  167.    if(this.arrNumber.length)
  168.    {
  169.       if(this.arrNumber.length == 3)
  170.       {
  171.          _root.Score += 10;
  172.       }
  173.       else if(this.arrNumber.length == 4)
  174.       {
  175.          _root.Score += 20;
  176.       }
  177.       else if(this.arrNumber.length == 5)
  178.       {
  179.          _root.Score += 30;
  180.       }
  181.       else
  182.       {
  183.          _root.Score += 40;
  184.       }
  185.    }
  186.    _root.mcAC3.gotoAndPlay("flC");
  187. }
  188. else
  189. {
  190.    _root.vol4.start();
  191.    eval("_root.mcB.mcM" + _root.strClick1 + ".mcM").gotoAndPlay("flD");
  192.    _root.mcKC.nNamugi = 0;
  193.    _root.strClick1 = "";
  194.    _root.strClick2 = "";
  195.    this.gotoAndStop(1);
  196. }
  197.